/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package helpers;

import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 *
 * @author Bari
 */
public class Debug {

    public static boolean SEND_SMS=false;//DOTO set it to true
    
    private static boolean DEBUG = true;//TODO set it to false
    
    private static final String TAGSEPARATOR = " >>> ";
    private static final String TIMESEPARATOR = " > ";

    public static void logMessage(Object tag, Object message) {
        if (DEBUG) {
            System.out.print(tag + TAGSEPARATOR + message);
        }
    }

    public static void logMessageAndTime(Object tag, Object message) {
        if (DEBUG) {
            Calendar cal = Calendar.getInstance();
            SimpleDateFormat formatter = new SimpleDateFormat("yy-MM-dd hh:mm:ss.SSS");
            System.out.print(formatter.format(cal.getTime()) + TIMESEPARATOR + tag + TAGSEPARATOR + message);
        }
    }

    public static void logError(Object tag, Object error) {
        if (DEBUG) {
            System.err.println(tag + TAGSEPARATOR + error);
        }
    }

    public static void logErrorAndTime(Object tag, Object error) {
        if (DEBUG) {
            Calendar cal = Calendar.getInstance();
            SimpleDateFormat formatter = new SimpleDateFormat("yy-MM-dd hh:mm:ss.SSS");
            System.err.print(formatter.format(cal.getTime()) + TIMESEPARATOR + tag + TAGSEPARATOR + error);
        }
    }
    
}
